package com.lagou.session;

import com.lagou.bean.Configuration;
import com.lagou.config.XMLConfigerBuilder;

import java.io.InputStream;

public class SqlSessionFactoryBuilder {
    private Configuration configuration;
    public SqlSessionFactoryBuilder() {
        this.configuration = new Configuration();
    }

    public SqlSessionFactory build(InputStream stream) throws Exception {
        XMLConfigerBuilder builder = new XMLConfigerBuilder();
        Configuration conf = builder.parseConf(stream);
        return new DefaultSqlSessionFactory(conf);
    }
}
